using System;
using System.Collections.Generic;
using System.Text;
namespace GSM.BusinessLayer
{
	public class Sysdiagrams: BusinessObjectBase
	{

		#region InnerClass
		public enum SysdiagramsFields
		{
			Name,
			Principal_id,
			Diagram_id,
			Version,
			Definition
		}
		#endregion

		#region Data Members

			string _name;
			int _principal_id;
			int _diagram_id;
			int? _version;
			byte[] _definition;

		#endregion

		#region Properties

		public string  Name
		{
			 get { return _name; }
			 set
			 {
				 if (_name != value)
				 {
					_name = value;
					 PropertyHasChanged("Name");
				 }
			 }
		}

		public int  Principal_id
		{
			 get { return _principal_id; }
			 set
			 {
				 if (_principal_id != value)
				 {
					_principal_id = value;
					 PropertyHasChanged("Principal_id");
				 }
			 }
		}

		public int  Diagram_id
		{
			 get { return _diagram_id; }
			 set
			 {
				 if (_diagram_id != value)
				 {
					_diagram_id = value;
					 PropertyHasChanged("Diagram_id");
				 }
			 }
		}

		public int?  Version
		{
			 get { return _version; }
			 set
			 {
				 if (_version != value)
				 {
					_version = value;
					 PropertyHasChanged("Version");
				 }
			 }
		}

		public byte[]  Definition
		{
			 get { return _definition; }
			 set
			 {
				 if (_definition != value)
				 {
					_definition = value;
					 PropertyHasChanged("Definition");
				 }
			 }
		}


		#endregion

		#region Validation

		internal override void AddValidationRules()
		{
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Name", "Name"));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("Name", "Name",128));
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Principal_id", "Principal_id"));
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Diagram_id", "Diagram_id"));
		}

		#endregion

	}
}
